package com.dj.mingkong.portal.biz.controller.system.vo.request;

import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.URL;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * 用户VO
 *
 * @author zenglonghui
 * @date: 2022/8/11 22:38
 */
@Data
@Accessors(chain = true)
public class UserUpdateVo implements Serializable {
    /**
     * 主键
     */
    @NotNull(message = "id can not be null")
    private Long id;

    /**
     * 昵称
     */
    @NotBlank(message = "nickname can not be blank")
    @Size(min = 2, max = 45, message = "nickname invalid")
    private String nickname;

    /**
     * 真实姓名
     */
    @Size(min = 2, max = 8, message = "realName invalid")
    private String realName;

    /**
     * 年龄
     */
    @NotNull(message = "age can not be null")
    @Max(value = 100, message = "age invalid")
    @Min(value = 1, message = "age invalid")
    @Positive(message = "age invalid")
    private Integer age;

    /**
     * 性别 0未知 1男 2女
     */
    @NotNull(message = "sex can not be null")
    @Max(value = 2, message = "sex invalid")
    @Min(value = 0, message = "sex invalid")
    @PositiveOrZero(message = "sex invalid")
    private Integer sex;

    /**
     * 生日
     */
    @Past(message = "birthday invalid")
    private LocalDate birthday;

    /**
     * 头像
     */
    @NotBlank(message = "avatarUrl can not be blank")
    @Size(min = 1, max = 230, message = "avatarUrl invalid")
    @URL(message = "avatarUrl invalid")
    private String avatarUrl;

    /**
     * 邮箱
     */
    @NotBlank(message = "email can not be blank")
    @Email(message = "email invalid")
    @Size(max = 90, message = "email invalid")
    private String email;

    @NotBlank(message = "mobile can not be blank")
    @Pattern(regexp = "^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\\d{8}$", message = "mobile invalid")
    private String mobile;

    /**
     * 兴趣
     */
    @Size(max = 230, message = "interest invalid")
    private String interest;

    /**
     * 个性
     */
    @Size(max = 230, message = "interest invalid")
    private String personality;

    /**
     * 所在城市
     */
    @Size(max = 18, message = "city invalid")
    private String city;

    /**
     * 个人介绍
     */
    @Size(max = 230, message = "city invalid")
    private String introduction;

}
